namespace Daemon.Service.Contract.Jwt
{
    using Microsoft.AspNetCore.Mvc;
    using System.Threading.Tasks;
    using Daemon.Model.Jwt;
    using Daemon.Model;
    using Daemon.Model.ViewModel;
	using System.Collections.Generic;
	using System.Security.Claims;

	public interface IJwtAppService : IService
    {
        #region APIs

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<JwtAuthorizationDto> CreateAuthTokenAsync(BaseUser dto, List<Claim> extraClaims = null);

        /// <summary>
        /// 刷新 Token
        /// </summary>
        /// <param name="token">Token</param>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<JwtAuthorizationDto> RefreshAsync(string token, BaseUser dto);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        Task<bool> IsCurrentActiveTokenAsync();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        Task DeactivateCurrentAsync();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="token">Token</param>
        /// <returns></returns>
        Task<bool> IsActiveAsync(string token);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        Task DeactivateAsync(string token);

        #endregion
    }
}
